import clientRequest from "@/utils/client-request.ts";

export function listProblemsApi(difficulty: number | undefined, keyword: string,
                                pageSize: number, pageNum: number) {
    return clientRequest({
        url: '/problems',
        method: 'GET',
        params: {
            difficulty: difficulty,
            keyword: keyword,
            pageSize: pageSize,
            pageNum: pageNum
        }
    })
}

export function getProblemDetailApi(problemId: string) {
    return clientRequest({
        url: '/problems/' + problemId,
        method: 'GET'
    })
}

export function getPrevProblemIdApi(problemId: string) {
    return clientRequest({
        url: '/problems/prev/' + problemId,
        method: 'GET'
    })
}

export function getNextProblemIdApi(problemId: string) {
    return clientRequest({
        url: '/problems/next/' + problemId,
        method: 'GET'
    })
}